﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using Furiant.Figment.Agents.Inventory;

namespace Furiant.Figment.Items.Lootable
{
    public class EquipSlotMap : ReadOnlyCollection<EquipSlotDefinition>
    {
        /// <summary>
        /// Creates a new instance of EquipSlotMap with the first element in the specified collection set
        /// as the Primary value and any other elements set as Referred values.
        /// </summary>
        /// <param name="collection">The contents of the map.</param>
        public EquipSlotMap(List<EquipSlotDefinition> collection)
            : base(collection.Distinct().ToList()) {}

        public EquipSlotDefinition Primary { get { return this[0]; } }

        public IEnumerable<EquipSlotDefinition> Referred { get { return this.Skip(1); } }

    }
}
